﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Style x:Key="MusicCollectionDataGridStyle" TargetType="{x:Type DataGrid}">
        <Setter Property="AutoGenerateColumns" Value="False"/>
        <Setter Property="Background" Value="{StaticResource ListBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource PassiveGenericBorderBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="CanUserAddRows" Value="False"/>
        <Setter Property="CanUserDeleteRows" Value="False"/>
        <Setter Property="CanUserReorderColumns" Value="False"/>
        <Setter Property="CanUserResizeRows" Value="False"/>
        <Setter Property="CanUserSortColumns" Value="True"/>
        <Setter Property="EnableColumnVirtualization" Value="False"/>
        <Setter Property="EnableRowVirtualization" Value="False"/>
        <Setter Property="HorizontalGridLinesBrush" Value="Transparent"/>
        <Setter Property="IsReadOnly" Value="True"/>
        <Setter Property="Margin" Value="0"/>
        <Setter Property="RowHeaderWidth" Value="0"/>
        <Setter Property="SelectionMode" Value="Extended"/>
        <Setter Property="SelectionUnit" Value="FullRow"/>
        <Setter Property="VerticalGridLinesBrush" Value="Transparent"/>
        <Setter Property="EnableRowVirtualization" Value="False"/>
        <Setter Property="EnableColumnVirtualization" Value="False"/>
        <Setter Property="VirtualizingStackPanel.IsVirtualizing" Value="False"/>
        <Setter Property="VirtualizingStackPanel.VirtualizationMode" Value="Standard"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type DataGrid}">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True">
                        <ScrollViewer x:Name="DG_ScrollViewer" Focusable="False">
                            <ScrollViewer.Template>
                                <ControlTemplate TargetType="{x:Type ScrollViewer}">
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="Auto"/>
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="*"/>
                                            <RowDefinition Height="Auto"/>
                                        </Grid.RowDefinitions>
                                        <DataGridColumnHeadersPresenter x:Name="PART_ColumnHeadersPresenter"
                                                                        Grid.Column="1" Grid.ColumnSpan="2" Visibility="Visible"/>
                                        <ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" Grid.ColumnSpan="2" CanVerticallyScroll="False" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" Grid.Row="1"/>
                                        <ScrollBar x:Name="PART_VerticalScrollBar" Style="{StaticResource ScrollBarStyle}" Grid.Column="2" Maximum="{TemplateBinding ScrollableHeight}" Orientation="Vertical" Grid.Row="1" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}"/>
                                        <Grid Grid.Column="1" Grid.Row="2">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="{Binding NonFrozenColumnsViewportHorizontalOffset, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type DataGrid}}}"/>
                                                <ColumnDefinition Width="*"/>
                                            </Grid.ColumnDefinitions>
                                            <ScrollBar x:Name="PART_HorizontalScrollBar" Style="{StaticResource ScrollBarStyle}" Grid.Column="1" Maximum="{TemplateBinding ScrollableWidth}" Orientation="Horizontal" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}"/>
                                        </Grid>
                                    </Grid>
                                </ControlTemplate>
                            </ScrollViewer.Template>
                            <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                        </ScrollViewer>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ColumnHeaderStyle">
            <Setter.Value>
                <Style TargetType="{x:Type DataGridColumnHeader}">
                    <Setter Property="Background" Value="{StaticResource ListHeaderBackgroundBrush}"/>
                    <Setter Property="BorderBrush" Value="{StaticResource HeaderBorderBrush}"/>
                    <Setter Property="BorderThickness" Value="0,0,0.75,1"/>
                    <Setter Property="Foreground" Value="{StaticResource PassiveTextBrush}"/>
                    <Setter Property="Padding" Value="10"/>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="RowStyle">
            <Setter.Value>
                <Style TargetType="{x:Type DataGridRow}">
                    <Setter Property="Background" Value="Transparent"/>
                    <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/>
                    <Style.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="Background" Value="{StaticResource RowSelectionBackgroundBrush}"/>
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="CellStyle">
            <Setter.Value>
                <Style TargetType="{x:Type DataGridCell}">
                    <Setter Property="Background" Value="{x:Null}"/>
                    <Setter Property="BorderThickness" Value="0"/>
                    <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
                    <Setter Property="Foreground" Value="{StaticResource PassiveTextBrush}"/>
                    <Setter Property="Margin" Value="10,1,0,1"/>
                    <Style.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="Foreground" Value="{StaticResource SelectedTextBrush}"/>
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>